/**
 * @Author: colpu
 * @Date: 2025-03-29 17:57:34
 * @LastEditors: colpu ycg520520@qq.com
 * @LastEditTime: 2025-05-30 13:30:28
 * @
 * @Copyright (c) 2025 by colpu, All Rights Reserved.
 */
import shell from "shelljs"; // 脚本执行
/**
 * @function service 执行命令方法
 * @param {String} env 环境变量
 * @param {String} argv bash 参数
 * @description 用于启动服务
 */
export default function service(env, argv) {
  process.env.NODE_ENV = env || "production";
  if (env === "development") {
    const bash = `nodemon ./node_modules/@colpu/cli/src/script/service.js`;
    shell.echo(bash);
    shell.exec(bash);
  } else {
    import("../script/service.js");
  }
}
